﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 机器人
{
    class DeliveryRobot:Robot
    {
        private int workHour;

        public DeliveryRobot(string name,int hours):base(name)
        {
            this.WorkHour = hours;
        }
        public int WorkHour 
        {
            get { return this.workHour; }
            set {
                if (value < 0)
                {
                    this.workHour = 0;
                }
                else
                {
                    this.workHour = value;
                }
            }
        }
        public DeliveryRobot()
        {

        }
        public override void Working()
        {
            if (this.WorkHour<12)
            {
            Console.WriteLine("我是{0}，我已经工作了{1}个小时",base.Name,this.WorkHour);
            }
            else if (this.WorkHour >= 12&& this.WorkHour <= 13)
            {
                Console.WriteLine("我的工作时间已经超过12个小时了 ， 我需要去充电");
            }
            else
            {
                Console.WriteLine("beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
            }
        }
    }
}
